/**
 * @author        Nicolas Bottarini <nicolasbottarini@gmail.com>, 404 <http://www.proyecto404.com>
 * @version       $Rev: 3 $
 * @lastrevision  $Date: 2011-09-12 16:45:37 +0000 (Mon, 12 Sep 2011) $	 
 */
package com.proyecto404.core.mvc.bootstrapperTasks {
	import com.proyecto404.core.BaseObject;
	import com.proyecto404.core.exception.AbstractMethodException;
	import com.proyecto404.core.mvc.Application;
	import com.proyecto404.core.mvc.IBootstrapperTask;
	
	import org.osflash.signals.Signal;

	/**
	 * @abstract
	 */
	public class BaseBootstrapperTask extends BaseObject implements IBootstrapperTask {
		
		private var _taskCompleted:Signal;
		private var _application:Application;

		public function BaseBootstrapperTask(application:Application) {
			_taskCompleted = new Signal();
			_application = application;
		}
		
		public function get application():Application {
			return _application;
		}
		
		public function get taskCompleted():Signal {
			return _taskCompleted;
		}
		
		/**
		 * @abstract
		 */
		public function execute():void { throw new AbstractMethodException(); }
		
		protected function notifyTaskCompletion():void {
			_taskCompleted.dispatch();	
		}
	}
}